package org.bbelovic.devel.snake;

import java.awt.Color;
import java.awt.Graphics;

public class Circle {

    private static final int DEFAULT_RADIUS = 20;
    private final Color color;
    private final int radius;
    private int x = 0;
    private int y = 0;
    
    public Circle(final Color color, final int radius, final int x, final int y) {
        this.color = color;
        this.radius = radius;
        this.x = x;
        this.y = y;
    }

    public Circle(final Color color, final int radius) {
        this (color, radius, 0, 0);
    }

    public Circle(final Color color) {
        this(color, DEFAULT_RADIUS);
    }
    
    public int getX() {
        return this.x;
    }
    
    public int getY() {
        return this.y;
    }
    
    public void setX(final int x) {
        this.x = x;
    }
    
    public void setY(final int y) {
        this.y = y;
    }
    
    public void moveTo(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public void paint(final Graphics g) {
        g.setColor(color);
        g.fillOval(x, y, radius, radius);
    }

    @Override
    public String toString() {
        return "x="+ this.x + " y="+ this.y;
    }
}
